#ifndef CONTACT_H
#define CONTACT_H

#include <Qt>
#include <QString>
#include <QStringList>
#include <QtSql>
#include "objtosql.h"


class Contact : public objToSQL
{
public:


    Contact();
    Contact(QString telephone1, QString telephone2, QString adresseMail, QString nom, QString prenom);
    Contact(QString telephone1, QString telephone2, QString adresseMail, QString nom, QString prenom, int priorite);
    Contact(QSqlQuery query, int i);

    void setClientId(int clientId);
    void setTelephone1(QString telephone1);
    void setTelephone2(QString telephone2);
    void setAdresseMail(QString adresseMail);
    void setNom(QString nom);
    void setPrenom(QString prenom);
    void setPriorite(int priorite);

    int getClientId()const;
    QString getTelephone1()const;
    QString getTelephone1WithSpaces()const;
    QString getTelephone2()const;
    QString getTelephone2WithSpaces()const;
    QString getAdresseMail()const;
    QString getNom()const;
    QString getPrenom()const;
    int getPriorite()const;
    QString NomEtPrenom()const;
    void BindValues(QSqlQuery &query, QStringList champs);

    bool operator ==(Contact const& contact);
    bool isNULL()const;

    static QStringList ListeChampSQL();
    static QStringList ListeChampSQLSansId();
    static QStringList ListeTypeDataSQL();
    static QStringList ListeTypeDataSQLSansId();
    static QStringList ChampDeTri();

    QStringList SQLWhere()const;
    QString SQLSet()const;
    QString SetQuery()const;
    QStringList SetBindValues()const;
    static QString SQLForeignKey();

    static const QString NomChampClientId;
    static const QString NomChampTelephone1;
    static const QString NomChampTelephone2;
    static const QString NomChampAdresseMail;
    static const QString NomChampNom;
    static const QString NomChampPrenom;
    static const QString NomChampPriorite;

private:
    int m_clientId;
    QString m_telephone1;
    QString m_telephone2;
    QString m_adresseMail;
    QString m_nom;
    QString m_prenom;
    int m_priorite;
};

#endif // CONTACT_H
